from django.shortcuts import render
from rest_framework import viewsets
from .models import Cabinet, Server
from .serializers import CabinetSerializer, ServerSerializer

# Create your views here.

from django.http import HttpRequest, HttpResponse

class CabinetViewSet(viewsets.ModelViewSet):
    """
    API endpoint that allows projects to be viewed or edited.
    """
    queryset = Cabinet.objects.all()
    serializer_class = CabinetSerializer

class ServerViewSet(viewsets.ModelViewSet):
    """
    API endpoint that allows projects to be viewed or edited.
    """
    queryset = Server.objects.all()
    serializer_class = ServerSerializer

def index(request):
  return HttpResponse('OK!')
